home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / D_RAS.ZIP / RAS.PAS next >
Encoding:
Pascal/Delphi Source File  |  1996-09-27  |  26.1 KB  |  766 lines

  1. {* Copyright (c) 1992-1995, Microsoft Corporation, all rights reserved
  2. **
  3. ** ras.h
  4. ** Remote Access external API
  5. ** Public header for external API clients
  6. *}
  7.  
  8. { Delphi conversion by Davide Moretti <dmoretti@iper.net> }
  9. { Note: All functions and structures defaults to Ansi. If you want to use
  10.   Unicode structs and funcs, use the names ending with 'W' }
  11.  
  12. unit Ras;
  13.  
  14. interface
  15.  
  16. uses Windows, Messages;
  17.  
  18. const
  19.  
  20. { These are from lmcons.h }
  21.  
  22.   DNLEN = 15;  // Maximum domain name length
  23.   UNLEN = 256; // Maximum user name length
  24.   PWLEN = 256; // Maximum password length
  25.   NETBIOS_NAME_LEN = 16; // NetBIOS net name (bytes)
  26.  
  27.   RAS_MaxDeviceType  = 16;
  28.   RAS_MaxPhoneNumber = 128;
  29.   RAS_MaxIpAddress   = 15;
  30.   RAS_MaxIpxAddress  = 21;
  31.  
  32. { Note: you must define WINVER31 before compiling this unit to get the sizes
  33.   for the 3.x version of RAS. The default is for Windows 95 and NT 4.0 }
  34.  
  35. {$IFDEF WINVER31}
  36. {Version 3.x sizes }
  37.   RAS_MaxEntryName      = 20;
  38.   RAS_MaxDeviceName     = 32;
  39.   RAS_MaxCallbackNumber = 48;
  40. {$ELSE}
  41. {Version 4.x sizes }
  42.   RAS_MaxEntryName      = 256;
  43.   RAS_MaxDeviceName     = 128;
  44.   RAS_MaxCallbackNumber = RAS_MaxPhoneNumber;
  45. {$ENDIF}
  46.  
  47. type
  48.  
  49.   LPHRasConn = ^THRasConn;
  50.   THRasConn = Longint;
  51.  
  52.  
  53. {* Identifies an active RAS connection.  (See RasEnumConnections)
  54. *}
  55.   LPRasConnW = ^TRasConnW;
  56.   TRasConnW = record
  57.     dwSize: Longint;
  58.     hrasconn: THRasConn;
  59.     szEntryName: Array[0..RAS_MaxEntryName] of WideChar;
  60. {$IFNDEF WINVER31}
  61.    szDeviceType: Array[0..RAS_MaxDeviceType] of WideChar;
  62.    szDeviceName: Array[0..RAS_MaxDeviceName] of WideChar;
  63. {$ENDIF}
  64.   end;
  65.  
  66.   LPRasConnA = ^TRasConnA;
  67.   TRasConnA = record
  68.     dwSize: Longint;
  69.     hrasconn: THRasConn;
  70.     szEntryName: Array[0..RAS_MaxEntryName] of AnsiChar;
  71. {$IFNDEF WINVER31}
  72.    szDeviceType: Array[0..RAS_MaxDeviceType] of AnsiChar;
  73.    szDeviceName: Array[0..RAS_MaxDeviceName] of AnsiChar;
  74. {$ENDIF}
  75.   end;
  76.  
  77.   LPRasConn = ^TRasConn;
  78.   TRasConn = TRasConnA;
  79.  
  80.  
  81. const
  82.  
  83. {* Enumerates intermediate states to a connection.  (See RasDial)
  84. *}
  85.   RASCS_PAUSED = $1000;
  86.   RASCS_DONE   = $2000;
  87.  
  88. type
  89.   LPRasConnState = ^TRasConnState;
  90.   TRasConnState = Integer;
  91.  
  92. const
  93.   RASCS_OpenPort = 0;
  94.   RASCS_PortOpened = 1;
  95.   RASCS_ConnectDevice = 2;
  96.   RASCS_DeviceConnected = 3;
  97.   RASCS_AllDevicesConnected = 4;
  98.   RASCS_Authenticate = 5;
  99.   RASCS_AuthNotify = 6;
  100.   RASCS_AuthRetry = 7;
  101.   RASCS_AuthCallback = 8;
  102.   RASCS_AuthChangePassword = 9;
  103.   RASCS_AuthProject = 10;
  104.   RASCS_AuthLinkSpeed = 11;
  105.   RASCS_AuthAck = 12;
  106.   RASCS_ReAuthenticate = 13;
  107.   RASCS_Authenticated = 14;
  108.   RASCS_PrepareForCallback = 15;
  109.   RASCS_WaitForModemReset = 16;
  110.   RASCS_WaitForCallback = 17;
  111.   RASCS_Projected = 18;
  112. {$IFNDEF WINVER31}
  113.   RASCS_StartAuthentication = 19;
  114.   RASCS_CallbackComplete = 20;
  115.   RASCS_LogonNetwork = 21;
  116. {$ENDIF}
  117.  
  118.   RASCS_Interactive = RASCS_PAUSED;
  119.   RASCS_RetryAuthentication = RASCS_PAUSED + 1;
  120.   RASCS_CallbackSetByCaller = RASCS_PAUSED + 2;
  121.   RASCS_PasswordExpired = RASCS_PAUSED + 3;
  122.  
  123.   RASCS_Connected = RASCS_DONE;
  124.   RASCS_Disconnected = RASCS_DONE + 1;
  125.  
  126. type
  127.  
  128. {* Describes the status of a RAS connection.  (See RasConnectionStatus)
  129. *}
  130.   LPRasConnStatusW = ^TRasConnStatusW;
  131.   TRasConnStatusW = record
  132.     dwSize: Longint;
  133.     rasconnstate: TRasConnState;
  134.     dwError: LongInt;
  135.     szDeviceType: Array[0..RAS_MaxDeviceType] of WideChar;
  136.     szDeviceName: Array[0..RAS_MaxDeviceName] of WideChar;
  137.   end;
  138.  
  139.   LPRasConnStatusA = ^TRasConnStatusA;
  140.   TRasConnStatusA = record
  141.     dwSize: Longint;
  142.     rasconnstate: TRasConnState;
  143.     dwError: LongInt;
  144.     szDeviceType: Array[0..RAS_MaxDeviceType] of AnsiChar;
  145.     szDeviceName: Array[0..RAS_MaxDeviceName] of AnsiChar;
  146.   end;
  147.  
  148.   LPRasConnStatus = ^TRasConnStatus;
  149.   TRasConnStatus = TRasConnStatusA;
  150.  
  151.  
  152. {* Describes connection establishment parameters.  (See RasDial)
  153. *}
  154.   LPRasDialParamsW = ^TRasDialParamsW;
  155.   TRasDialParamsW = record
  156.     dwSize: LongInt;
  157.     szEntryName: Array[0..RAS_MaxEntryName] of WideChar;
  158.     szPhoneNumber: Array[0..RAS_MaxPhoneNumber] of WideChar;
  159.     szCallbackNumber: Array[0..RAS_MaxCallbackNumber] of WideChar;
  160.     szUserName: Array[0..UNLEN] of WideChar;
  161.     szPassword: Array[0..PWLEN] of WideChar;
  162.     szDomain: Array[0..DNLEN] of WideChar;
  163.   end;
  164.  
  165.   LPRasDialParamsA = ^TRasDialParamsA;
  166.   TRasDialParamsA = record
  167.     dwSize: LongInt;
  168.     szEntryName: Array[0..RAS_MaxEntryName] of AnsiChar;
  169.     szPhoneNumber: Array[0..RAS_MaxPhoneNumber] of AnsiChar;
  170.     szCallbackNumber: Array[0..RAS_MaxCallbackNumber] of AnsiChar;
  171.     szUserName: Array[0..UNLEN] of AnsiChar;
  172.     szPassword: Array[0..PWLEN] of AnsiChar;
  173.     szDomain: Array[0..DNLEN] of AnsiChar;
  174.   end;
  175.  
  176.   LPRasDialParams = ^TRasDialParams;
  177.   TRasDialParams = TRasDialParamsA;
  178.  
  179.  
  180. {* Describes extended connection establishment options.  (See RasDial)
  181. *}
  182.   LPRasDialExtensions = ^TRasDialExtensions;
  183.   TRasDialExtensions = record
  184.     dwSize: LongInt;
  185.     dwfOptions: LongInt;
  186.     hwndParent: HWND;
  187.     reserved: LongInt;
  188.   end;
  189.  
  190. {* 'dwfOptions' bit flags.
  191. *}
  192. const
  193.   RDEOPT_UsePrefixSuffix           = $00000001;
  194.   RDEOPT_PausedStates              = $00000002;
  195.   RDEOPT_IgnoreModemSpeaker        = $00000004;
  196.   RDEOPT_SetModemSpeaker           = $00000008;
  197.   RDEOPT_IgnoreSoftwareCompression = $00000010;
  198.   RDEOPT_SetSoftwareCompression    = $00000020;
  199.  
  200.  
  201. type
  202.  
  203. {* Describes an enumerated RAS phone book entry name.  (See RasEntryEnum)
  204. *}
  205.   LPRasEntryNameW = ^TRasEntryNameW;
  206.   TRasEntryNameW = record
  207.     dwSize: Longint;
  208.     szEntryName: Array[0..RAS_MaxEntryName] of WideChar;
  209.   end;
  210.  
  211.   LPRasEntryNameA = ^TRasEntryNameA;
  212.   TRasEntryNameA = record
  213.     dwSize: Longint;
  214.     szEntryName: Array[0..RAS_MaxEntryName] of AnsiChar;
  215.   end;
  216.  
  217.   LPRasEntryName = ^TRasEntryName;
  218.   TRasEntryName = TRasEntryNameA;
  219.  
  220.  
  221. {* Protocol code to projection data structure mapping.
  222. *}
  223.   LPRasProjection = ^TRasProjection;
  224.   TRasProjection = Integer;
  225.  
  226. const
  227.   RASP_Amb = $10000;
  228.   RASP_PppNbf = $803F;
  229.   RASP_PppIpx = $802B;
  230.   RASP_PppIp = $8021;
  231.  
  232.  
  233. type
  234.  
  235. {* Describes the result of a RAS AMB (Authentication Message Block)
  236. ** projection.  This protocol is used with NT 3.1 and OS/2 1.3 downlevel
  237. ** RAS servers.
  238. *}
  239.   LPRasAmbW = ^TRasAmbW;
  240.   TRasAmbW = record
  241.     dwSize: Longint;
  242.     dwError: Longint;
  243.     szNetBiosError: Array[0..NETBIOS_NAME_LEN] of WideChar;
  244.     bLana: Byte;
  245.   end;
  246.  
  247.   LPRasAmbA = ^TRasAmbA;
  248.   TRasAmbA = record
  249.     dwSize: Longint;
  250.     dwError: Longint;
  251.     szNetBiosError: Array[0..NETBIOS_NAME_LEN] of AnsiChar;
  252.     bLana: Byte;
  253.   end;
  254.  
  255.   LPRasAmb = ^TRasAmb;
  256.   TRasAmb = TRasAmbA;
  257.  
  258.  
  259. {* Describes the result of a PPP NBF (NetBEUI) projection.
  260. *}
  261.   LPRasPppNbfW = ^TRasPppNbfW;
  262.   TRasPppNbfW = record
  263.     dwSize: Longint;
  264.     dwError: Longint;
  265.     dwNetBiosError: Longint;
  266.     szNetBiosError: Array[0..NETBIOS_NAME_LEN] of WideChar;
  267.     szWorkstationName: Array[0..NETBIOS_NAME_LEN] of WideChar;
  268.     bLana: Byte;
  269.   end;
  270.  
  271.   LPRasPppNbfA = ^TRasPppNbfA;
  272.   TRasPppNbfA = record
  273.     dwSize: Longint;
  274.     dwError: Longint;
  275.     dwNetBiosError: Longint;
  276.     szNetBiosError: Array[0..NETBIOS_NAME_LEN] of AnsiChar;
  277.     szWorkstationName: Array[0..NETBIOS_NAME_LEN] of AnsiChar;
  278.     bLana: Byte;
  279.   end;
  280.  
  281.   LpRaspppNbf = ^TRasPppNbf;
  282.   TRasPppNbf = TRasPppNbfA;
  283.  
  284.  
  285. {* Describes the results of a PPP IPX (Internetwork Packet Exchange)
  286. ** projection.
  287. *}
  288.   LPRasPppIpxW = ^TRasPppIpxW;
  289.   TRasPppIpxW = record
  290.     dwSize: Longint;
  291.     dwError: Longint;
  292.     szIpxAddress: Array[0..RAS_MaxIpxAddress] of WideChar;
  293.  end;
  294.  
  295.   LPRasPppIpxA = ^TRasPppIpxA;
  296.   TRasPppIpxA = record
  297.     dwSize: Longint;
  298.     dwError: Longint;
  299.     szIpxAddress: Array[0..RAS_MaxIpxAddress] of AnsiChar;
  300.  end;
  301.  
  302.   LPRasPppIpx = ^TRasPppIpx;
  303.   TRasPppIpx = TRasPppIpxA;
  304.  
  305.  
  306. {* Describes the results of a PPP IP (Internet) projection.
  307. *}
  308.   LPRasPppIpW = ^TRasPppIpW;
  309.   TRasPppIpW = record
  310.     dwSize: Longint;
  311.     dwError: Longint;
  312.     szIpAddress: Array[0..RAS_MaxIpAddress] of WideChar;
  313.  
  314. {$IFNDEF WINNT35COMPATIBLE}
  315.  
  316.     {* This field was added between Windows NT 3.51 beta and Windows NT 3.51
  317.     ** final, and between Windows 95 M8 beta and Windows 95 final.  If you do
  318.     ** not require the server address and wish to retrieve PPP IP information
  319.     ** from Windows NT 3.5 or early Windows NT 3.51 betas, or on early Windows
  320.     ** 95 betas, define WINNT35COMPATIBLE.
  321.     **
  322.     ** The server IP address is not provided by all PPP implementations,
  323.     ** though Windows NT server's do provide it.
  324.     *}
  325.     szServerIpAddress: Array[0..RAS_MaxIpAddress] of WideChar;
  326.  
  327. {$ENDIF}
  328.   end;
  329.  
  330.   LPRasPppIpA = ^TRasPppIpA;
  331.   TRasPppIpA = record
  332.     dwSize: Longint;
  333.     dwError: Longint;
  334.     szIpAddress: Array[0..RAS_MaxIpAddress] of AnsiChar;
  335.  
  336. {$IFNDEF WINNT35COMPATIBLE}
  337.  
  338.     {* See RASPPPIPW comment.
  339.     *}
  340.     szServerIpAddress: Array[0..RAS_MaxIpAddress] of AnsiChar;
  341.  
  342. {$ENDIF}
  343.   end;
  344.  
  345.   LPRasPppIp = ^TRasPppIp;
  346.   TRasPppIp = TRasPppIpA;
  347.  
  348.  
  349. const
  350.  
  351. {* If using RasDial message notifications, get the notification message code
  352. ** by passing this string to the RegisterWindowMessageA() API.
  353. ** WM_RASDIALEVENT is used only if a unique message cannot be registered.
  354. *}
  355.   RASDIALEVENT    = 'RasDialEvent';
  356.   WM_RASDIALEVENT = $CCCD;
  357.  
  358.  
  359. {* Prototypes for caller's RasDial callback handler.  Arguments are the
  360. ** message ID (currently always WM_RASDIALEVENT), the current RASCONNSTATE and
  361. ** the error that has occurred (or 0 if none).  Extended arguments are the
  362. ** handle of the RAS connection and an extended error code.
  363. *}
  364. {
  365. typedef VOID (WINAPI *RASDIALFUNC)( UINT, RASCONNSTATE, DWORD );
  366. typedef VOID (WINAPI *RASDIALFUNC1)( HRASCONN, UINT, RASCONNSTATE, DWORD, DWORD );
  367.  
  368. For Delphi: Just define the callback as
  369. procedure RASCallback(msg: Integer; state: TRasConnState;
  370.     dwError: Longint); stdcall;
  371.  or
  372. procedure RASCallback1(hConn: THRasConn; msg: Integer;
  373.     state: TRasConnState; dwError: Longint; dwEexterror: Longint); stdcall;
  374. }
  375.  
  376. {* External RAS API function prototypes.
  377. *}
  378. {Note: for Delphi the function without 'A' or 'W' is the Ansi one
  379.   as on the other Delphi headers}
  380.  
  381. function RasDialA(
  382.     lpRasDialExt: LPRasDialExtensions;
  383.     lpszPhoneBook: PAnsiChar;
  384.     var params: TRasDialParamsA;
  385.     dwNotifierType: Longint;
  386.     lpNotifier: Pointer;
  387.     var rasconn: THRasConn
  388.     ): Longint; stdcall;
  389. function RasDialW(
  390.     lpRasDialExt: LPRasDialExtensions;
  391.     lpszPhoneBook: PWideChar;
  392.     var params: TRasDialParamsW;
  393.     dwNotifierType: Longint;
  394.     lpNotifier: Pointer;
  395.     var rasconn: THRasConn
  396.     ): Longint; stdcall;
  397. function RasDial(
  398.     lpRasDialExt: LPRasDialExtensions;
  399.     lpszPhoneBook: PAnsiChar;
  400.     var params: TRasDialParams;
  401.     dwNotifierType: Longint;
  402.     lpNotifier: Pointer;
  403.     var rasconn: THRasConn
  404.     ): Longint; stdcall;
  405.  
  406. function RasEnumConnectionsA(
  407.     rasconnArray: LPRasConnA;
  408.     var lpcb: Longint;
  409.     var lpcConnections: Longint
  410.     ): Longint; stdcall;
  411. function RasEnumConnectionsW(
  412.     rasconnArray: LPRasConnW;
  413.     var lpcb: Longint;
  414.     var lpcConnections: Longint
  415.     ): Longint; stdcall;
  416. function RasEnumConnections(
  417.     rasconnArray: LPRasConn;
  418.     var lpcb: Longint;
  419.     var lpcConnections: Longint
  420.     ): Longint; stdcall;
  421.  
  422. function RasEnumEntriesA(
  423.     reserved: PAnsiChar;
  424.     lpszPhoneBook: PAnsiChar;
  425.     entrynamesArray: LPRasEntryNameA;
  426.     var lpcb: Longint;
  427.     var lpcEntries: Longint
  428.     ): Longint; stdcall;
  429. function RasEnumEntriesW(
  430.     reserved: PWideChar;
  431.     lpszPhoneBook: PWideChar;
  432.     entrynamesArray: LPRasEntryNameW;
  433.     var lpcb: Longint;
  434.     var lpcEntries: Longint
  435.     ): Longint; stdcall;
  436. function RasEnumEntries(
  437.     reserved: PAnsiChar;
  438.     lpszPhoneBook: PAnsiChar;
  439.     entrynamesArray: LPRasEntryName;
  440.     var lpcb: Longint;
  441.     var lpcEntries: Longint
  442.     ): Longint; stdcall;
  443.  
  444. function RasGetConnectStatusA(
  445.     hConn: THRasConn;
  446.     var lpStatus: TRasConnStatusA
  447.     ): Longint; stdcall;
  448. function RasGetConnectStatusW(
  449.     hConn: THRasConn;
  450.     var lpStatus: TRasConnStatusW
  451.     ): Longint; stdcall;
  452. function RasGetConnectStatus(
  453.     hConn: THRasConn;
  454.     var lpStatus: TRasConnStatus
  455.     ): Longint; stdcall;
  456.  
  457. function RasGetErrorStringA(
  458.     errorValue: Integer;
  459.     erroString: PAnsiChar;
  460.     cBufSize: Longint
  461.     ): Longint; stdcall;
  462. function RasGetErrorStringW(
  463.     errorValue: Integer;
  464.     erroString: PWideChar;
  465.     cBufSize: Longint
  466.     ): Longint; stdcall;
  467. function RasGetErrorString(
  468.     errorValue: Integer;
  469.     erroString: PAnsiChar;
  470.     cBufSize: Longint
  471.     ): Longint; stdcall;
  472.  
  473. function RasHangUpA(
  474.   hConn: THRasConn
  475.   ): Longint; stdcall;
  476. function RasHangUpW(
  477.   hConn: THRasConn
  478.   ): Longint; stdcall;
  479. function RasHangUp(
  480.   hConn: THRasConn
  481.   ): Longint; stdcall;
  482.  
  483. function RasGetProjectionInfoA(
  484.   hConn: THRasConn;
  485.   rasproj: TRasProjection;
  486.   lpProjection: Pointer;
  487.   var lpcb: Longint
  488.   ): Longint; stdcall;
  489. function RasGetProjectionInfoW(
  490.   hConn: THRasConn;
  491.   rasproj: TRasProjection;
  492.   lpProjection: Pointer;
  493.   var lpcb: Longint
  494.   ): Longint; stdcall;
  495. function RasGetProjectionInfo(
  496.   hConn: THRasConn;
  497.   rasproj: TRasProjection;
  498.   lpProjection: Pointer;
  499.   var lpcb: Longint
  500.   ): Longint; stdcall;
  501.  
  502. function RasCreatePhonebookEntryA(
  503.   hwndParentWindow: HWND;
  504.   lpszPhoneBook: PAnsiChar
  505.   ): Longint; stdcall;
  506. function RasCreatePhonebookEntryW(
  507.   hwndParentWindow: HWND;
  508.   lpszPhoneBook: PWideChar
  509.   ): Longint; stdcall;
  510. function RasCreatePhonebookEntry(
  511.   hwndParentWindow: HWND;
  512.   lpszPhoneBook: PAnsiChar
  513.   ): Longint; stdcall;
  514.  
  515. function RasEditPhonebookEntryA(
  516.   hwndParentWindow: HWND;
  517.   lpszPhoneBook: PAnsiChar;
  518.   lpszEntryName: PAnsiChar
  519.   ): Longint; stdcall;
  520. function RasEditPhonebookEntryW(
  521.   hwndParentWindow: HWND;
  522.   lpszPhoneBook: PWideChar;
  523.   lpszEntryName: PWideChar
  524.   ): Longint; stdcall;
  525. function RasEditPhonebookEntry(
  526.   hwndParentWindow: HWND;
  527.   lpszPhoneBook: PAnsiChar;
  528.   lpszEntryName: PAnsiChar
  529.   ): Longint; stdcall;
  530.  
  531. function RasSetEntryDialParamsA(
  532.   lpszPhoneBook: PAnsiChar;
  533.   var lpDialParams: TRasDialParamsA;
  534.   fRemovePassword: LongBool
  535.   ): Longint; stdcall;
  536. function RasSetEntryDialParamsW(
  537.   lpszPhoneBook: PWideChar;
  538.   var lpDialParams: TRasDialParamsW;
  539.   fRemovePassword: LongBool
  540.   ): Longint; stdcall;
  541. function RasSetEntryDialParams(
  542.   lpszPhoneBook: PAnsiChar;
  543.   var lpDialParams: TRasDialParams;
  544.   fRemovePassword: LongBool
  545.   ): Longint; stdcall;
  546.  
  547. function RasGetEntryDialParamsA(
  548.   lpszPhoneBook: PAnsiChar;
  549.   var lpDialParams: TRasDialParamsA;
  550.   var lpfPassword: LongBool
  551.   ): Longint; stdcall;
  552. function RasGetEntryDialParamsW(
  553.   lpszPhoneBook: PWideChar;
  554.   var lpDialParams: TRasDialParamsW;
  555.   var lpfPassword: LongBool
  556.   ): Longint; stdcall;
  557. function RasGetEntryDialParams(
  558.   lpszPhoneBook: PAnsiChar;
  559.   var lpDialParams: TRasDialParams;
  560.   var lpfPassword: LongBool
  561.   ): Longint; stdcall;
  562.  
  563.  
  564. {**
  565. ** raserror.h
  566. ** Remote Access external API
  567. ** RAS specific error codes
  568. *}
  569.  
  570. const
  571.   RASBASE = 600;
  572.   SUCCESS = 0;
  573.  
  574.   PENDING                              = (RASBASE+0);
  575.   ERROR_INVALID_PORT_HANDLE            = (RASBASE+1);
  576.   ERROR_PORT_ALREADY_OPEN              = (RASBASE+2);
  577.   ERROR_BUFFER_TOO_SMALL               = (RASBASE+3);
  578.   ERROR_WRONG_INFO_SPECIFIED           = (RASBASE+4);
  579.   ERROR_CANNOT_SET_PORT_INFO           = (RASBASE+5);
  580.   ERROR_PORT_NOT_CONNECTED             = (RASBASE+6);
  581.   ERROR_EVENT_INVALID                  = (RASBASE+7);
  582.   ERROR_DEVICE_DOES_NOT_EXIST          = (RASBASE+8);
  583.   ERROR_DEVICETYPE_DOES_NOT_EXIST      = (RASBASE+9);
  584.   ERROR_BUFFER_INVALID                 = (RASBASE+10);
  585.   ERROR_ROUTE_NOT_AVAILABLE            = (RASBASE+11);
  586.   ERROR_ROUTE_NOT_ALLOCATED            = (RASBASE+12);
  587.   ERROR_INVALID_COMPRESSION_SPECIFIED  = (RASBASE+13);
  588.   ERROR_OUT_OF_BUFFERS                 = (RASBASE+14);
  589.   ERROR_PORT_NOT_FOUND                 = (RASBASE+15);
  590.   ERROR_ASYNC_REQUEST_PENDING          = (RASBASE+16);
  591.   ERROR_ALREADY_DISCONNECTING          = (RASBASE+17);
  592.   ERROR_PORT_NOT_OPEN                  = (RASBASE+18);
  593.   ERROR_PORT_DISCONNECTED              = (RASBASE+19);
  594.   ERROR_NO_ENDPOINTS                   = (RASBASE+20);
  595.   ERROR_CANNOT_OPEN_PHONEBOOK          = (RASBASE+21);
  596.   ERROR_CANNOT_LOAD_PHONEBOOK          = (RASBASE+22);
  597.   ERROR_CANNOT_FIND_PHONEBOOK_ENTRY    = (RASBASE+23);
  598.   ERROR_CANNOT_WRITE_PHONEBOOK         = (RASBASE+24);
  599.   ERROR_CORRUPT_PHONEBOOK              = (RASBASE+25);
  600.   ERROR_CANNOT_LOAD_STRING             = (RASBASE+26);
  601.   ERROR_KEY_NOT_FOUND                  = (RASBASE+27);
  602.   ERROR_DISCONNECTION                  = (RASBASE+28);
  603.   ERROR_REMOTE_DISCONNECTION           = (RASBASE+29);
  604.   ERROR_HARDWARE_FAILURE               = (RASBASE+30);
  605.   ERROR_USER_DISCONNECTION             = (RASBASE+31);
  606.   ERROR_INVALID_SIZE                   = (RASBASE+32);
  607.   ERROR_PORT_NOT_AVAILABLE             = (RASBASE+33);
  608.   ERROR_CANNOT_PROJECT_CLIENT          = (RASBASE+34);
  609.   ERROR_UNKNOWN                        = (RASBASE+35);
  610.   ERROR_WRONG_DEVICE_ATTACHED          = (RASBASE+36);
  611.   ERROR_BAD_STRING                     = (RASBASE+37);
  612.   ERROR_REQUEST_TIMEOUT                = (RASBASE+38);
  613.   ERROR_CANNOT_GET_LANA                = (RASBASE+39);
  614.   ERROR_NETBIOS_ERROR                  = (RASBASE+40);
  615.   ERROR_SERVER_OUT_OF_RESOURCES        = (RASBASE+41);
  616.   ERROR_NAME_EXISTS_ON_NET             = (RASBASE+42);
  617.   ERROR_SERVER_GENERAL_NET_FAILURE     = (RASBASE+43);
  618.   WARNING_MSG_ALIAS_NOT_ADDED          = (RASBASE+44);
  619.   ERROR_AUTH_INTERNAL                  = (RASBASE+45);
  620.   ERROR_RESTRICTED_LOGON_HOURS         = (RASBASE+46);
  621.   ERROR_ACCT_DISABLED                  = (RASBASE+47);
  622.   ERROR_PASSWD_EXPIRED                 = (RASBASE+48);
  623.   ERROR_NO_DIALIN_PERMISSION           = (RASBASE+49);
  624.   ERROR_SERVER_NOT_RESPONDING          = (RASBASE+50);
  625.   ERROR_FROM_DEVICE                    = (RASBASE+51);
  626.   ERROR_UNRECOGNIZED_RESPONSE          = (RASBASE+52);
  627.   ERROR_MACRO_NOT_FOUND                = (RASBASE+53);
  628.   ERROR_MACRO_NOT_DEFINED              = (RASBASE+54);
  629.   ERROR_MESSAGE_MACRO_NOT_FOUND        = (RASBASE+55);
  630.   ERROR_DEFAULTOFF_MACRO_NOT_FOUND     = (RASBASE+56);
  631.   ERROR_FILE_COULD_NOT_BE_OPENED       = (RASBASE+57);
  632.   ERROR_DEVICENAME_TOO_LONG            = (RASBASE+58);
  633.   ERROR_DEVICENAME_NOT_FOUND           = (RASBASE+59);
  634.   ERROR_NO_RESPONSES                   = (RASBASE+60);
  635.   ERROR_NO_COMMAND_FOUND               = (RASBASE+61);
  636.   ERROR_WRONG_KEY_SPECIFIED            = (RASBASE+62);
  637.   ERROR_UNKNOWN_DEVICE_TYPE            = (RASBASE+63);
  638.   ERROR_ALLOCATING_MEMORY              = (RASBASE+64);
  639.   ERROR_PORT_NOT_CONFIGURED            = (RASBASE+65);
  640.   ERROR_DEVICE_NOT_READY               = (RASBASE+66);
  641.   ERROR_READING_INI_FILE               = (RASBASE+67);
  642.   ERROR_NO_CONNECTION                  = (RASBASE+68);
  643.   ERROR_BAD_USAGE_IN_INI_FILE          = (RASBASE+69);
  644.   ERROR_READING_SECTIONNAME            = (RASBASE+70);
  645.   ERROR_READING_DEVICETYPE             = (RASBASE+71);
  646.   ERROR_READING_DEVICENAME             = (RASBASE+72);
  647.   ERROR_READING_USAGE                  = (RASBASE+73);
  648.   ERROR_READING_MAXCONNECTBPS          = (RASBASE+74);
  649.   ERROR_READING_MAXCARRIERBPS          = (RASBASE+75);
  650.   ERROR_LINE_BUSY                      = (RASBASE+76);
  651.   ERROR_VOICE_ANSWER                   = (RASBASE+77);
  652.   ERROR_NO_ANSWER                      = (RASBASE+78);
  653.   ERROR_NO_CARRIER                     = (RASBASE+79);
  654.   ERROR_NO_DIALTONE                    = (RASBASE+80);
  655.   ERROR_IN_COMMAND                     = (RASBASE+81);
  656.   ERROR_WRITING_SECTIONNAME            = (RASBASE+82);
  657.   ERROR_WRITING_DEVICETYPE             = (RASBASE+83);
  658.   ERROR_WRITING_DEVICENAME             = (RASBASE+84);
  659.   ERROR_WRITING_MAXCONNECTBPS          = (RASBASE+85);
  660.   ERROR_WRITING_MAXCARRIERBPS          = (RASBASE+86);
  661.   ERROR_WRITING_USAGE                  = (RASBASE+87);
  662.   ERROR_WRITING_DEFAULTOFF             = (RASBASE+88);
  663.   ERROR_READING_DEFAULTOFF             = (RASBASE+89);
  664.   ERROR_EMPTY_INI_FILE                 = (RASBASE+90);
  665.   ERROR_AUTHENTICATION_FAILURE         = (RASBASE+91);
  666.   ERROR_PORT_OR_DEVICE                 = (RASBASE+92);
  667.   ERROR_NOT_BINARY_MACRO               = (RASBASE+93);
  668.   ERROR_DCB_NOT_FOUND                  = (RASBASE+94);
  669.   ERROR_STATE_MACHINES_NOT_STARTED     = (RASBASE+95);
  670.   ERROR_STATE_MACHINES_ALREADY_STARTED = (RASBASE+96);
  671.   ERROR_PARTIAL_RESPONSE_LOOPING       = (RASBASE+97);
  672.   ERROR_UNKNOWN_RESPONSE_KEY           = (RASBASE+98);
  673.   ERROR_RECV_BUF_FULL                  = (RASBASE+99);
  674.   ERROR_CMD_TOO_LONG                   = (RASBASE+100);
  675.   ERROR_UNSUPPORTED_BPS                = (RASBASE+101);
  676.   ERROR_UNEXPECTED_RESPONSE            = (RASBASE+102);
  677.   ERROR_INTERACTIVE_MODE               = (RASBASE+103);
  678.   ERROR_BAD_CALLBACK_NUMBER            = (RASBASE+104);
  679.   ERROR_INVALID_AUTH_STATE             = (RASBASE+105);
  680.   ERROR_WRITING_INITBPS                = (RASBASE+106);
  681.   ERROR_X25_DIAGNOSTIC                 = (RASBASE+107);
  682.   ERROR_ACCT_EXPIRED                   = (RASBASE+108);
  683.   ERROR_CHANGING_PASSWORD              = (RASBASE+109);
  684.   ERROR_OVERRUN                        = (RASBASE+110);
  685.   ERROR_RASMAN_CANNOT_INITIALIZE         = (RASBASE+111);
  686.   ERROR_BIPLEX_PORT_NOT_AVAILABLE      = (RASBASE+112);
  687.   ERROR_NO_ACTIVE_ISDN_LINES           = (RASBASE+113);
  688.   ERROR_NO_ISDN_CHANNELS_AVAILABLE     = (RASBASE+114);
  689.   ERROR_TOO_MANY_LINE_ERRORS           = (RASBASE+115);
  690.   ERROR_IP_CONFIGURATION               = (RASBASE+116);
  691.   ERROR_NO_IP_ADDRESSES                = (RASBASE+117);
  692.   ERROR_PPP_TIMEOUT                    = (RASBASE+118);
  693.   ERROR_PPP_REMOTE_TERMINATED          = (RASBASE+119);
  694.   ERROR_PPP_NO_PROTOCOLS_CONFIGURED    = (RASBASE+120);
  695.   ERROR_PPP_NO_RESPONSE                = (RASBASE+121);
  696.   ERROR_PPP_INVALID_PACKET             = (RASBASE+122);
  697.   ERROR_PHONE_NUMBER_TOO_LONG          = (RASBASE+123);
  698.   ERROR_IPXCP_NO_DIALOUT_CONFIGURED    = (RASBASE+124);
  699.   ERROR_IPXCP_NO_DIALIN_CONFIGURED     = (RASBASE+125);
  700.   ERROR_IPXCP_DIALOUT_ALREADY_ACTIVE   = (RASBASE+126);
  701.   ERROR_ACCESSING_TCPCFGDLL            = (RASBASE+127);
  702.   ERROR_NO_IP_RAS_ADAPTER              = (RASBASE+128);
  703.   ERROR_SLIP_REQUIRES_IP               = (RASBASE+129);
  704.   ERROR_PROJECTION_NOT_COMPLETE        = (RASBASE+130);
  705.   ERROR_PROTOCOL_NOT_CONFIGURED        = (RASBASE+131);
  706.   ERROR_PPP_NOT_CONVERGING             = (RASBASE+132);
  707.   ERROR_PPP_CP_REJECTED                = (RASBASE+133);
  708.   ERROR_PPP_LCP_TERMINATED             = (RASBASE+134);
  709.   ERROR_PPP_REQUIRED_ADDRESS_REJECTED  = (RASBASE+135);
  710.   ERROR_PPP_NCP_TERMINATED             = (RASBASE+136);
  711.   ERROR_PPP_LOOPBACK_DETECTED          = (RASBASE+137);
  712.   ERROR_PPP_NO_ADDRESS_ASSIGNED        = (RASBASE+138);
  713.   ERROR_CANNOT_USE_LOGON_CREDENTIALS   = (RASBASE+139);
  714.   ERROR_TAPI_CONFIGURATION             = (RASBASE+140);
  715.   ERROR_NO_LOCAL_ENCRYPTION            = (RASBASE+141);
  716.   ERROR_NO_REMOTE_ENCRYPTION           = (RASBASE+142);
  717.   ERROR_REMOTE_REQUIRES_ENCRYPTION     = (RASBASE+143);
  718.   ERROR_IPXCP_NET_NUMBER_CONFLICT      = (RASBASE+144);
  719.   ERROR_INVALID_SMM                    = (RASBASE+145);
  720.   ERROR_SMM_UNINITIALIZED              = (RASBASE+146);
  721.   ERROR_NO_MAC_FOR_PORT                = (RASBASE+147);
  722.   ERROR_SMM_TIMEOUT                    = (RASBASE+148);
  723.   ERROR_BAD_PHONE_NUMBER               = (RASBASE+149);
  724.   ERROR_WRONG_MODULE                   = (RASBASE+150);
  725.  
  726.  
  727.   RASBASEEND                           = (RASBASE+150);
  728.  
  729. implementation
  730.  
  731. function RasCreatePhonebookEntryA; external 'rasapi32.dll' name 'RasCreatePhonebookEntryA';
  732. function RasCreatePhonebookEntryW; external 'rasapi32.dll' name 'RasCreatePhonebookEntryW';
  733. function RasCreatePhonebookEntry;  external 'rasapi32.dll' name 'RasCreatePhonebookEntryA';
  734. function RasDialA;                 external 'rasapi32.dll' name 'RasDialA';
  735. function RasDialW;                 external 'rasapi32.dll' name 'RasDialW';
  736. function RasDial;                  external 'rasapi32.dll' name 'RasDialA';
  737. function RasEditPhonebookEntryA;   external 'rasapi32.dll' name 'RasEditPhonebookEntryA';
  738. function RasEditPhonebookEntryW;   external 'rasapi32.dll' name 'RasEditPhonebookEntryW';
  739. function RasEditPhonebookEntry;    external 'rasapi32.dll' name 'RasEditPhonebookEntryA';
  740. function RasEnumConnectionsA;      external 'rasapi32.dll' name 'RasEnumConnectionsA';
  741. function RasEnumConnectionsW;      external 'rasapi32.dll' name 'RasEnumConnectionsW';
  742. function RasEnumConnections;       external 'rasapi32.dll' name 'RasEnumConnectionsA';
  743. function RasEnumEntriesA;          external 'rasapi32.dll' name 'RasEnumEntriesA';
  744. function RasEnumEntriesW;          external 'rasapi32.dll' name 'RasEnumEntriesW';
  745. function RasEnumEntries;           external 'rasapi32.dll' name 'RasEnumEntriesA';
  746. function RasGetConnectStatusA;     external 'rasapi32.dll' name 'RasGetConnectStatusA';
  747. function RasGetConnectStatusW;     external 'rasapi32.dll' name 'RasGetConnectStatusW';
  748. function RasGetConnectStatus;      external 'rasapi32.dll' name 'RasGetConnectStatusA';
  749. function RasGetEntryDialParamsA;   external 'rasapi32.dll' name 'RasGetEntryDialParamsA';
  750. function RasGetEntryDialParamsW;   external 'rasapi32.dll' name 'RasGetEntryDialParamsW';
  751. function RasGetEntryDialParams;    external 'rasapi32.dll' name 'RasGetEntryDialParamsA';
  752. function RasGetErrorStringA;       external 'rasapi32.dll' name 'RasGetErrorStringA';
  753. function RasGetErrorStringW;       external 'rasapi32.dll' name 'RasGetErrorStringW';
  754. function RasGetErrorString;        external 'rasapi32.dll' name 'RasGetErrorStringA';
  755. function RasGetProjectionInfoA;    external 'rasapi32.dll' name 'RasGetProjectionInfoA';
  756. function RasGetProjectionInfoW;    external 'rasapi32.dll' name 'RasGetProjectionInfoW';
  757. function RasGetProjectionInfo;     external 'rasapi32.dll' name 'RasGetProjectionInfoA';
  758. function RasHangUpA;               external 'rasapi32.dll' name 'RasHangUpA';
  759. function RasHangUpW;               external 'rasapi32.dll' name 'RasHangUpW';
  760. function RasHangUp;                external 'rasapi32.dll' name 'RasHangUpA';
  761. function RasSetEntryDialParamsA;   external 'rasapi32.dll' name 'RasSetEntryDialParamsA';
  762. function RasSetEntryDialParamsW;   external 'rasapi32.dll' name 'RasSetEntryDialParamsW';
  763. function RasSetEntryDialParams;    external 'rasapi32.dll' name 'RasSetEntryDialParamsA';
  764.  
  765. end.
  766.